#include "backbtnitem.h"
#include <QPainter>
#include "commondef.h"

#define BACK_BTN_W          60.0f
#define BACK_BTN_H          40.0f

BackBtnItem::BackBtnItem()
{
}

void BackBtnItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->drawText(QRectF(20.0f,0.0f,60.0f,H1),Qt::AlignCenter,tr("back"));

    QPolygonF polygon;
    polygon << QPointF(17.0f, 12.0f) << QPointF(3.0f, 20.0f)
            << QPointF(17.0f, 28.0f);

    QPainterPath path;
    path.addPolygon(polygon);
    painter->fillPath(path,QColor(Qt::black));
}

QRectF BackBtnItem::boundingRect() const
{
    return QRectF(0.0f,0.0f,80.0f,H1);
}
